<template>
	<view class="bar" :style="{height: barHeight + 'px'}" v-if="showBar"></view>
</template>

<script>
	const app = getApp();
	export default {
		name:"u-bar-height",
		data() {
			return {
				showBar: false,
				barHeight: 0
			};
		},
		
		mounted() {
			let barHeight = uni.getSystemInfoSync().statusBarHeight;
			console.log(barHeight)
			this.showBar = barHeight ? true : false;
			this.barHeight = barHeight;
			app.globalData.barHeight = barHeight;
		}
	}
</script>

<style>		
	.bar{
		width: 100%;
		z-index: 9;
		background-color: #fff;
	}
</style>